package design.mode.treemenu;

/**
 * @author ldanniel
 * @description todo
 * @date 2023/09/20:51
 * @since jdk11
 */

import java.util.List;


public class Menu {
    private String id;
    private String parentId;
    private String text;
    private String url;
    private String valid;
    private List<Menu> children;

//        public Menu(String id,String parentId,String text,String url,String yxbz) {
//        this.id=id;
//        this.parentId=parentId;
//        this.text=text;
//        this.url=url;
//        this.valid=yxbz;
//    }


    public Menu(Builder builder) {
        this.id = builder.id;
        this.parentId = builder.parentId;
        this.text = builder.text;
        this.url = builder.url;
        this.valid = builder.valid;
        this.children = builder.children;
    }

    public static class Builder {
        private String id;
        private String parentId;
        private String text;
        private String url;
        private String valid;
        private List<Menu> children;

        public Builder id(String id) {
            this.id = id;
            return this;
        }

        public Builder parentId(String parentId) {
            this.parentId = parentId;
            return this;
        }

        public Builder text(String text) {
            this.text = text;
            return this;
        }

        public Builder url(String url) {
            this.url = url;
            return this;
        }

        public Builder valid(String valid) {
            this.valid = valid;
            return this;
        }

        public Builder children(List<Menu> children) {
            this.children = children;
            return this;
        }

        public Menu build() {
            return new Menu(this);
        }
    }

    public void setId(String id) {
        this.id = id;
    }

    public void setParentId(String parentId) {
        this.parentId = parentId;
    }

    public void setText(String text) {
        this.text = text;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public void setValid(String valid) {
        this.valid = valid;
    }

    public void setChildren(List<Menu> children) {
        this.children = children;
    }

    public String getId() {
        return id;
    }

    public String getParentId() {
        return parentId;
    }

    public String getText() {
        return text;
    }

    public String getUrl() {
        return url;
    }

    public String getValid() {
        return valid;
    }

    public List<Menu> getChildren() {
        return children;
    }
}